/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"98574267-C223-400E-B423-286C7BE0C9DC"}
 */
var fResultado = null;


/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"7A36430F-5D7E-426C-82C7-4BC937D5C9E9"}
 */
function seleccionaTodos(event) {
	var $fs = gensayo_to_ensayos.ensayos_to_resultados_dtl
	var $cant = databaseManager.getFoundSetCount($fs)
	
	fResultado = null
	
	for (var i = 1 ; i <= $cant ; i++)
	{
		var $rcd = $fs.getRecord(i)
		
		fResultado += $rcd.valor + '\n' 
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"86206211-5205-49F6-A12E-455C90814B62"}
 */
function seleccionaNinguno(event) {
	fResultado = null
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"36E48D3E-B414-4B4D-965B-CE3972088602"}
 */
function aceptar(event) {
	forms.estadisticas_1.fResultados 	= fResultado.split('\n')
	forms.estadisticas_1.fResultado 	= fResultado
	cancelar()
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} [event] the event that triggered the action
 *
 * @properties={typeid:24,uuid:"F2F6C365-C8A6-469A-8BF7-6454B3FE2F12"}
 */
function cancelar(event) {
	var $win = application.getWindow('RESULTADOS')
	$win.hide()
	$win.destroy()
	fResultado = null
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"8AB1AA71-00D1-4EA5-ABF6-F104E8FC2A48"}
 */
function onShow(firstShow, event) {
	fResultado = forms.estadisticas_1.fResultados.join('\n')
}
